home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0067.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  2.1 KB  |  53 lines

  1. On 06-Mar-98, Magnus.Sjoberg@asdo.se smashed the keyboard with:
  2. >> 's a little trick I found the other day, hope somebody can
  3. > use it..
  4. >> store an integer-array you would normaly open a sequentiel
  5. > file and dump
  6. >> data with a loop.. Well try this instead:
  7. >> =50
  8. >> A(MX)
  9. >> -
  10. >> FILE$,Varptr(A(0)) To Varptr(A(0))+(MX+1)*4
  11. >> 
  12. >> to reload:
  13. >> FILE$,Varptr(A(0))
  14. >> 
  15. >> can simply replace Bsave with Ssave if you'd like to have
  16. > more than one
  17. >> in a file. Or use Copy to put in a bank :)
  18. >     Thanx for the tip. It's just what I need.
  19. >     Loop-storing/reading are so slow when it comes to bigger files.
  20. >     But how about big numbers and strings? I sence a bit of trouble
  21. > here...
  22.  
  23. Strings don't work :(
  24. All regular integer-arrays work (A(n), B(n)) etc.. With a little change it
  25. is possible to use multi-dimension arrays. The (MX+1) should just be changed
  26. to the number of elements in the array, so if you have a Dim A(6,6) then the
  27. (MX+1) is changed to (7*7) element 0 is the first, resulting in 7 in each 
  28. dimension..
  29.  
  30. Integer holds numbers from -$80000000 -> $7FFFFFFF wich equals to 
  31. -2.147.483.648 -> 2.147.483.647, if you'd like to use floating numbers like
  32. A#(n) then the *4 is changed to the length of each element in the floating
  33. set (Still *4 if you're using Single/Fast float, but *8 if you are using
  34. Double Precision numbers..).. 
  35.  
  36. -- 
  37. Kind regards from
  38. ______________________________________________________________________________
  39.  /_  __/ __  / __  /\  ___\  __ \__  _\               aka. JENS VANG PETERSEN
  40.   / / / /_/ / ____/  \ \___\  __ \ \ \                  top_cat@post8.tele.dk
  41.  /_/ /_____/_/        \_____\_\ \_\ \_\
  42. ------------------------------------------------------------------------------
  43.                     http://home8.inet.tele.dk/top_cat/
  44.   -+-    Home of 'The Ultimate Extension list' for AMOS TC & AMOS PRO    -+-
  45.                  -+-  SUPPORT - AMOS - AMIGA - AQUA  -+-
  46. ------------------------------------------------------------------------------
  47.  Hardware:  The parts of a computer system that can be kicked.
  48. ------------------------------------------------------------------------------
  49.  
  50.  
  51.